/*   
 * Copyright (c) 2010-2020 DMGIS Ltd. All Rights Reserved.   
 *   
 * This software is the confidential and proprietary information of   
 * DMGIS. You shall not disclose such Confidential Information   
 * and shall use it only in accordance with the terms of the agreements   
 * you entered into with DMGIS.   
 *   
 */
package com.dmgis.qxfw.dataservice.businessservice.common.util;


import com.dmgis.qxfw.dataservice.businessservice.api.domain.DbConfig;
import com.dmgis.qxfw.dataservice.commonservice.utils.PGUtil;
import com.github.kevinsawicki.http.HttpRequest;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 微信token信息类 This class is used for ...
 * 
 * @author dsq
 * @version 1.0, 2018年11月6日 上午11:15:26
 */
public class TokenDao {

	private String appId;
	private String secret;

	/**
	 * 构造一个微信账号
	 * 
	 * @param appId
	 * @param secret
	 */
	public TokenDao(String appId, String secret) {
		this.appId = appId;
		this.secret = secret;
	};




	/// <summary>
	/// 微信api接口调用
	/// </summary>
	/// <param name="postUrl"></param>
	/// <returns></returns>
	private String WiKiHttpRequest(String postUrl) {
		String json = "";// 需要解析json数据
		json = HttpRequest.post(postUrl).body();
		// HttpWebRequest myHttpWebRequest =
		// System.Net.WebRequest.Create(postUrl) as HttpWebRequest;
		// myHttpWebRequest.KeepAlive = false;
		// myHttpWebRequest.AllowAutoRedirect = false;
		// myHttpWebRequest.UserAgent = "Mozilla/5.0 (compatible; MSIE 6.0;
		// Windows NT 5.1; SV1; .NET CLR 2.0.50727)";
		// myHttpWebRequest.Timeout = 10000;
		// myHttpWebRequest.ContentType =
		// "application/x-www-form-urlencoded;charset=utf-8";
		// using (HttpWebResponse res =
		// (HttpWebResponse)myHttpWebRequest.GetResponse())
		// {
		// if (res.StatusCode == HttpStatusCode.OK || res.StatusCode ==
		// HttpStatusCode.PartialContent)//返回为200或206
		// {
		// String dd = res.ContentEncoding;
		// System.IO.Stream strem = res.GetResponseStream();
		// System.IO.StreamReader r = new System.IO.StreamReader(strem);
		// json = r.ReadToEnd();
		// }
		// }
		return json;
	}


}
